package com.demo.controller;
import com.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

//版本2——张三
@Controller
public class UserController2 {

    @Autowired
    private User user;

    public void doMethod(){
        User user2=user;
        System.out.println("UserController2修改之前：USer->"+user);
        user2.setName("张三");
        System.out.println("UserController2修改之后：USer->"+user);
    }
}
